/*
 *  Copyright (C) void Team 2010 Pedro Batista
 * 
 *  http://code.google.com/p/capacitec
 * 
 *  This file is part of capacitec.
 * 
 *  capacitec is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  capacitec is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with capacitec.  If not, see <http://www.gnu.org/licenses/>.
 */

package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author pedro
 */
@Entity
@Table(name = "erro")
@NamedQueries({
	@NamedQuery(name = "Erro.findAll", query = "SELECT e FROM Erro e"),
	@NamedQuery(name = "Erro.findById", query = "SELECT e FROM Erro e WHERE e.id = :id"),
	@NamedQuery(name = "Erro.findByException", query = "SELECT e FROM Erro e WHERE e.exception = :exception"),
	@NamedQuery(name = "Erro.findBySituacao", query = "SELECT e FROM Erro e WHERE e.situacao = :situacao")})
public class Erro implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Basic(optional = false)
        @Column(name = "id", nullable = false)
	private Integer id;
	@Basic(optional = false)
        @Lob
        @Column(name = "descricao", nullable = false, length = 65535)
	private String descricao;
	@Column(name = "exception", length = 255)
	private String exception;
	@Basic(optional = false)
        @Column(name = "situacao", nullable = false, length = 10)
	private String situacao;

	public Erro() {
	}

	public Erro(Integer id) {
		this.id = id;
	}

	public Erro(Integer id, String descricao, String situacao) {
		this.id = id;
		this.descricao = descricao;
		this.situacao = situacao;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getException() {
		return exception;
	}

	public void setException(String exception) {
		this.exception = exception;
	}

	public String getSituacao() {
		return situacao;
	}

	public void setSituacao(String situacao) {
		this.situacao = situacao;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are not set
		if (!(object instanceof Erro)) {
			return false;
		}
		Erro other = (Erro) object;
		if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "entidades.Erro[id=" + id + "]";
	}

}
